package jobs;


import model.PicDatabaseModel;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
public class DeleteOldPicturesJob implements Job
	{
		//Alle 24 Minuten um 12 Uhr Mittags einmal durchlaufen
	    public DeleteOldPicturesJob() {
	    }
	   
	    
		
		public void execute(JobExecutionContext context) throws JobExecutionException 
	    {	    	
	    	
	    	java.util.Date oneYearFromNow = new java.util.Date();
	    	oneYearFromNow.setYear(oneYearFromNow.getYear()-1);
	    	
	    	
	    	PicDatabaseModel picDAO = new PicDatabaseModel();
	    	
	    	picDAO.DeletePicture(oneYearFromNow);
	    }	    
		
		
	}
